<!--
 * @Author: zhangxiangsheng 1026583651@qq.com
 * @Date: 2024-06-18 13:57:45
 * @LastEditors: zhangxiangsheng 1026583651@qq.com
 * @LastEditTime: 2024-06-25 08:54:24
 * @FilePath: \appGly\pages\Station\StationHD\StationedtHDprintid.vue
 * @Description: 
 * 
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved. 
-->
<template>
	<view>
		<u-navbar title="全卡通设置"></u-navbar>
		<formz ref="formz" v-if="showform" :inputs="inputs" :data="data"></formz>
		<fixedbtn>
			<u-button type="primary" @click="save" :loading="loading">
				{{ $z.$t("确认修改") }}
			</u-button>
		</fixedbtn>
	</view>
</template>

<script>
	import json from "@/pages/ChargeCar/indexjson.js";
	export default {
		data() {
			return {
				inputs: [{
					value: "printid",
					label: this.$z.$t("全通卡卡号")
				}],
				loading: false,
				data: {},
				showform: false,
			};
		},
		onLoad(query) {
			this.query = query;
			this.init();
		},
		methods: {
			async init() {
				let StationHD = await this.$z.request("/StationHD", {
					id: this.query.id,
				});
				StationHD = StationHD.length == 1 ? StationHD[0] : {};

				this.data = {
					...StationHD,
				};
				this.showform = true;
				// console.log(this.data, " this.data");
			},
			async save() {
				let data = await this.$refs.formz.validate();

				this.loading = true;
				let par = await this.$z.request("/StationedtHD", data);

				this.loading = false;
				this.$z.back();
			},
		},
	};
</script>

<style></style>